package com.platform.controller;

import com.platform.service.HotelService;
import com.platform.service.UserHotelService;
import com.platform.utils.PageUtils;
import com.platform.utils.Query;
import com.platform.utils.R;
import com.platform.vo.UserHotelVo;
import com.platform.vo.UserInviteesVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @Author chenweigang
 * @Data 2020/9/24
 *
 * 微信公众号用户指定酒店列表
 */
@RestController
@RequestMapping("hotel")
public class WxMqController {
     @Autowired
    private UserHotelService userHotelService;

     @PostMapping("/list")
      public R list(@RequestParam Map<String,Object> params){
         Query query = new Query(params);
         List<UserHotelVo> orderList = userHotelService.queryUserHotelList(query);
         int total = userHotelService.queryTotal(query);
         PageUtils pageUtil = new PageUtils(orderList,total,query.getLimit(),query.getPage());
         return R.ok().put("page", pageUtil);

     }




}
